<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
	//初始化
	initProvince('province', 'city', 'county', 'town');
	$.metadata.setType("attr", "validate");
	$("#order_form").validate({
		success : function(label) {
			label.text("").addClass("validate_success");
		},
		rules : {
			memberName:{
				required : true
			},
			phone:{
				required : true
			},
			address:{
				required : true
			}
		},
		messages : {
			memberName:{
				required : "不能为空"
			},
			phone:{
				required : "不能为空"
			},
			address:{
				required : "不能为空"
			}
		},
		//提交由submitHandler拦截
		submitHandler : function() {
			$.post("order.htm",{
				addressee:$("#memberName").val(),
				quantity:"${buyNum}",
				phone:$("#phone").val(),
				address:$("#address").val(),
				provinceCode:$("#province").val(),
				province:$("#province").find("option:selected").text(),
			    cityCode:$("#city").val(),
			    city:$("#city").find("option:selected").text(),
			    countyCode:$("#county").val(),
			    county:$("#county").find("option:selected").text(),
				remark:$("#description").val(),
				product:"${productId}"
			},function(data){
				if(data=='success'){
					alert("恭喜，下单成功！您可以在我家的订单栏目内查看！");
					window.location.href="myOrderProduct.htm"
				}else{
					alert("对不起，下单失败！请重新下单！");
					window.location.href="product.htm"
				}
			});	
			
		}

	});
});
	
	
</script>


	<div class="tcWrapper_y ordTotalWid">
    	<div class="tcHeader_y ordWidth">
        	<b class="tcLTAngel_y"></b>
            <b class="tcRTAngel_y"></b>
        </div>
        <div class="ggrzWrap">
       	  <div class="ggTitle ordWidth">
            	<h4 class="redColor">订单明细</h4>
                <span class="ordName">订单名称：<i>果果街商品订单</i></span>
                <a href="javascript:void(0)" onclick="$('#roder_dialog').hide();hideMask();">
               	 <img src="imgs/login-close.png" />
				</a>
       	  </div>
          <div class="ordCpName">
          		<p><span>商品名称：</span><i class="colorRed fontWeight">${product.title}</i></p>
                <p><span>数量：</span><i class="colorRed fontWeight">${buyNum}</i></p>
          </div>
          <div class="boxPad5">
          	<form id="order_form">
          		<div class="boxInPad5">
                	<span>联系人：</span><%-- ${order.addressee} --%><input type="text"  id="memberName" name="memberName" value="" /><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<span>电话：</span><input type="text" id="phone" name="phone" value="" class="tel" /><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<span>收货地址：</span><select id="province" name="province" ></select>
					<select id="city" name="city"></select>
					<select id="county" name="county"></select><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<span>所在地：</span><input type="text" id="address" name="address" class="commonT colorBlack" /><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<span>邮编：</span><input type="text"  id="zipcode" name="zipcode"/><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<span class="expSpan">备注：</span><textarea id="description" name="description" ></textarea><i class="alertSpan">*</i>
                </div>
                <div class="boxInPad5">
                	<input type="submit" class="tjBtn r3" value="确定" id="order_submit"/>
                </div>
          </form>
          </div>
      </div>
        <div class="tcBottom_y ordWidth">
        	<b class="tcLBAngel_y"></b>
            <b class="tcRBAngel_y"></b>
        </div>
    </div>
